
.app-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  // padding: 2rem;

  &--overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    z-index: 1000;
  }

  &--fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
  }
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Spinner 类型 */
.spinner {
  position: relative;
  width: 40px;
  height: 40px;

  &--small {
    width: 24px;
    height: 24px;
    
    .spinner-ring {
      border-width: 2px;
    }
  }

  &--large {
    width: 56px;
    height: 56px;
    
    .spinner-ring {
      border-width: 4px;
    }
  }
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top: 3px solid var(--spinner-color, '#4693C7');
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Dots 类型 */
.dots {
  display: flex;
  gap: 0.5rem;

  &--small {
    gap: 0.25rem;
    
    .dot {
      width: 8px;
      height: 8px;
    }
  }

  &--large {
    gap: 0.75rem;
    
    .dot {
      width: 16px;
      height: 16px;
    }
  }
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite both;

  &--1 {
    animation-delay: -0.32s;
  }

  &--2 {
    animation-delay: -0.16s;
  }

  &--3 {
    animation-delay: 0s;
  }
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Pulse 类型 */
.pulse {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;

  &--small {
    width: 24px;
    height: 24px;
  }

  &--large {
    width: 56px;
    height: 56px;
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
}

/* Bars 类型 */
.bars {
  display: flex;
  gap: 0.25rem;
  height: 40px;

  &--small {
    height: 24px;
    gap: 0.125rem;
    
    .bar {
      width: 4px;
    }
  }

  &--large {
    height: 56px;
    gap: 0.375rem;
    
    .bar {
      width: 8px;
    }
  }
}

.bar {
  width: 6px;
  border-radius: 3px;
  animation: bars 1.2s ease-in-out infinite;

  &--1 {
    animation-delay: -0.4s;
  }

  &--2 {
    animation-delay: -0.2s;
  }

  &--3 {
    animation-delay: 0s;
  }

  &--4 {
    animation-delay: 0.2s;
  }
}

@keyframes bars {
  0%, 40%, 100% {
    transform: scaleY(0.4);
  }
  20% {
    transform: scaleY(1);
  }
}

.loading-text {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
  font-weight: 500;
}

.progress-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 200px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .app-loading {
    padding: 1rem;
  }
  
  .loading-text {
    font-size: 0.8rem;
  }
  
  .progress-container {
    width: 150px;
  }
}

/* 暗色主题支持 */
// @media (prefers-color-scheme: dark) {
//   .app-loading--overlay {
//     background: rgba(0, 0, 0, 0.3);
//   }
  
//   .app-loading--fullscreen {
//     background: rgba(0, 0, 0, 0.8);
//   }
  
//   .loading-text {
//     color: #d1d5db;
//   }
  
//   .progress-bar {
//     background: #374151;
//   }
  
//   .progress-text {
//     color: #d1d5db;
//   }
  
//   .spinner-ring::before {
//     background: #1f2937;
//   }
// }